/**
 * 
 */
package com.dsteiner.widgets.client.util;

import com.dsteiner.widgets.client.util.ValidationUtil.Error;

public class ValidationError implements Error{
	private final String message;
	private final String[] fields;

	public ValidationError(String message, String... field) {
		this.message = message;
		this.fields = field;
	}
	public String getMessage() {
		return message;
	}
	public String[] getField() {
		return fields;
	}
	public boolean contains(String field) {
		for (int i = 0; i < fields.length; i++) {
			if(fields[i].equals(field))
				return true;
		}
		return false;
	}
}